//===================================================================================
// $$
//
// Coder: Code Milker v1.0
// 0 - upper
// 1 - lower
//===================================================================================


namespace App.Domain.Handlers {
    using System;
    using App.Data;
    using App.Domain.Contracts;

    public class DeleteEducation {
        private readonly IEducationRepository _EducationRepository;

        public DeleteEducation(IEducationRepository EducationRepository) {
            _EducationRepository = EducationRepository;
        }

        public virtual void Execute(Guid educationId) {
            var EducationToDelete = _EducationRepository.GetEducation(educationId);

            if (EducationToDelete != null) {
                _EducationRepository.Delete(educationId);
            }
            else {
                throw new BusinessServicesException("UnableToDeleteVehicleExceptionMessage");
            }
        }
    }
}
